package com.duying.gh.manager;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.duying.gh.GhCommonManager;
import com.duying.gh.model.BaseUnitType;

public class BaseUnitTypeManager extends GhCommonManager{
	
	
	public List getListSelect(){
		String hql = "from BaseUnitType x where x.auditing = 1 order by x.type_code asc";
		List list = this.baseDao.getByHQL(hql);
		List listSelect = new ArrayList();
		Map VirtualMap = new HashMap();
		VirtualMap.put("pvalue","  ");
		VirtualMap.put("pkey",0);
		listSelect.add(VirtualMap);
		
		for(Object obj : list){
			int depth = 1;
			BaseUnitType c = (BaseUnitType)obj;
			Map map = new HashMap();
			map.put("pvalue",c.getType_code() + "  " + c.getType_name());
			map.put("pkey",c.getId());
			listSelect.add(map);
		}
		return listSelect;
	}
	
	
	public Integer getId(BaseUnitType butype){
		if(butype == null){
			return 99;
		}else{
			return butype.getId();
		}
	}
}
